package mce.cuce;

public class DbService {
	
	/**
	 * Gets the longUrl for given shortUrl from database
	 * @param shortUrl
	 * @return	longUrl if exists, null otherwise.
	 */
	public static String getLongUrl(String shortUrl) {
		return null;
	}
	
	/**
	 * Adds the shortUrl and longUrl to database.
	 * @param shortUrl
	 * @param longUrl
	 * @return	true if record successfully saved, false otherwise.
	 */
	public static boolean addUrl(String shortUrl, String longUrl) {
		return false;
	}
	
	/**
	 * Returns the next auto incremented id from database
	 * @return
	 */
	public static int getNextId() {
		return 0;
	}
	
	
	
	/**
	 * Gets database id for string s
	 * @param s	part after the slash in short url. Example http://www.domain.com/abcd	-> s = abcd
	 * @return	
	 */
	private int getIdFromUrl(String s) {
		return UrlUtilities.base62_decode(s);
	}
}
